Intro
The world runs on energy, and for the last 2 centuries, a major source of the worlds energy has been oil. Historically, it has been an incredibly profitable and necessary industry. Today, oil and gas provide 80%80% of American energy, and provide >12 million American jobs.
The purpose of this blog is to analyze what institutions believe to be the most impactful effects of war, and inspect those arguments using supporting data and visualizations from a variety of sources.
Content
You can include text, code, and output as usual.
Remember to take full advantage of Markdown and follow our Style
Guide.
Visualization 1
To begin our analysis, we sought out articles relating to a series of key words that are relevant to our topic of interest. These articles were found through using a few different key word searches such as: “Israel-Gaza Conflict”, “Global Macroeconomic Environment”, “Economic Impact of war” and “How war impacts national economies”. After performing these searches, we selected articles that had relevant publication dates for our analysis window (early 2022-present). We were sure to include text from different instutions such as Governments/National Banks, News Media groups, and high ranking individuals in the private sector.
We selected a series of articles from different institutions (Banks,
Government, News & Media) that had titles relating to current
international conflicts and economic sentiment. This word frequency
analysis helped us decide where we should target our further analysis to
explore the impact that war has on the global macro environment. Among
this list: Oil, prices, and inflation were of great interest.
(sources listed below)
Jerome
Powell speaks on Raising the benchmark Fed Funds Rate
Visualization 2
CPI (Consumer Price Index) is the average price paid by a consumer for a “basket” of consumer goods. Here, we are looking at the CPI for a U.S. consumer from 2017-2022. CPI is also used as an indicator for inflation. The purpose of this plot is to provide some context for the further analysis that will be performed. The CPI has increased steadily over time, but we are interested in seeing if in recent years, global conflicts were drivers of that increase.
Visualization 3
Over the years, oil pricing has been significantly influenced by key geopolitical moments. From conflicts to major geopolitical shifts, the plot sheds light on how world events send shockwaves through the oil market. Vertical dashed lines mark pivotal occasions, such as the onset of the Russia-Ukraine War in February 2022 and the Iraq War in March 2003, offering a clear visual of their immediate impact on oil prices. This visualization serves as a concise yet insightful exploration, illustrating the interconnected relationship between geopolitical happenings and the fluctuations in oil prices, unraveling the narrative of how the global stage shapes the cost of this vital resource.
Further Exploration
Uses subsection syntax to get the tabs. Looks cool I think
Oil (Interactive Visuzlization)
You can make a bulleted list like this:
- item 1
- item 2
- item 3
Trade (Network)
You can make a numbered list like this
- First thing I want to say
- Second thing I want to say
- Third thing I want to say
Links
Examples and additional guidance are provided below.
Take note of the the default code chunk options in the
setup code chunk. For example, unlike the rest of the Rmd
files we worked in this semester, the default code chunk option is
echo = FALSE, so you will need to set
echo = TRUE for any code chunks you would like to display
in the blog. You should be thoughtful and intentional about the code you
choose to display.
You can include links using Markdown syntax as shown.
You should include links to relevant sites as you write. You should additionally include a list of references as the end of your blog with full citations (and relevant links).
Visualizations
Visualizations, particularly interactive ones, will be well-received. That said, do not overuse visualizations. You may be better off with one complicated but well-crafted visualization as opposed to many quick-and-dirty plots. Any plots should be well-thought-out, properly labeled, informative, and visually appealing.
If you want to include dynamic visualizations or tables, you should explore your options from packages that are built from htmlwidgets. These htmlwidgets-based packages offer ways to build lighterweight, dynamic visualizations or tables that don’t require an R server to run! A more complete list of packages is available on the linked website, but a short list includes:
- plotly: Interactive graphics with D3
- leaflet: Interactive maps with OpenStreetMap
- dygraphs: Interactive time series visualization
- visNetwork: Network graph visualization vis.js
- sparkline: Small inline charts
- threejs: Interactive 3D graphics
You may embed a published Shiny app in your blog if useful, but be aware that there is a limited window size for embedded objects, which tends to makes the user experience of the app worse relative to a dedicated Shiny app page. Additionally, Shiny apps will go idle after a few minutes and have to be reloaded by the user, which may also affect the user experience.
Any Shiny apps embedded in your blog should be accompanied by the link to the published Shiny app (I did this using a figure caption in the code chunk below, but you don’t have to incorporate the link in this way).
Tables
DT package
The DT package is great for making dynamic tables that can be displayed, searched, and filtered by the user without needing an R server or Shiny app!
Note: you should load any packages you use in the setup
code chunk as usual. The library() functions are shown
below just for demonstration.
library(DT)
mtcars %>%
select(mpg, cyl, hp) %>%
datatable(colnames = c("MPG", "Number of cylinders", "Horsepower"),
filter = 'top',
options = list(pageLength = 10, autoWidth = TRUE))
kableExtra package
You can also use kableExtra for customizing HTML tables.
library(kableExtra)
summary(cars) %>%
kbl(col.names = c("Speed", "Distance"),
row.names = FALSE) %>%
kable_styling(bootstrap_options = "striped",
full_width = FALSE) %>%
row_spec(0, bold = TRUE) %>%
column_spec(1:2, width = "1.5in")
| Speed | Distance |
|---|---|
| Min. : 4.0 | Min. : 2.00 |
| 1st Qu.:12.0 | 1st Qu.: 26.00 |
| Median :15.0 | Median : 36.00 |
| Mean :15.4 | Mean : 42.98 |
| 3rd Qu.:19.0 | 3rd Qu.: 56.00 |
| Max. :25.0 | Max. :120.00 |
Images
Images and gifs can be displayed using code chunks:
“Safe Space” by artist Kenesha Sneed
This is a figure caption
You may also use Markdown syntax for displaying images as shown below, but code chunks offer easier customization of the image size and alignment.
Either way, the file path can be a local path within your project directory or a URL for an image hosted online. This syntax works for PNG, PDF, JPG, and even GIF formats.
Videos
You can use code chunks or Markdown syntax include links to any valid YouTube or Vimeo URLs (see here for details) or point to a location within your project directory.
Code chunk:
Markdown syntax:
You may need to push your updates to GitHub to see if the videos work.
Equations
You might include equations if part of the purpose of your blog is to explain a statistical method. There are two ways to include equations:
- Inline: \(b \sim N(0, \sigma^2_b)\)
- Display-style (displayed on its own line): \[\frac{\sigma^2_b}{\sigma^2_b + \sigma^2_e}\]
For typesetting equations appropriately, check out the AMS-LaTeX quick reference or take a look at the Symbols in math mode section of this cheat sheet (or do some extra Googling—there are many resources).
Formatting
Tabbed subsections
Each subsection below the “Tabbed subsections” section heading will appear in a tab. See R Markdown Cookbook Section 7.6: Put content in tabs for additional customization options.
Bulleted list
You can make a bulleted list like this:
- item 1
- item 2
- item 3
Numbered list
You can make a numbered list like this
- First thing I want to say
- Second thing I want to say
- Third thing I want to say
Column formatting
Content Column 1
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vel ipsum eu sem facilisis porttitor. Integer eu tristique lectus. Vestibulum nisi risus, porta sit amet cursus nec, auctor ac tellus. Integer egestas viverra rhoncus. Fusce id sem non ante vestibulum posuere ac sed lorem. Proin id felis a mi pellentesque viverra in at nulla. Duis augue nulla, aliquet ac ligula a, sagittis varius lorem.
Content Column 2
Aliquam non ante et erat luctus hendrerit eu ac justo. Fusce lacinia pulvinar neque non laoreet. Fusce vitae mauris pharetra, scelerisque purus eget, pharetra nisl. Aenean volutpat elementum tortor vitae rhoncus. Phasellus nec tellus euismod neque congue imperdiet tincidunt in mauris. Morbi eu lorem molestie, hendrerit lorem nec, semper massa. Sed vulputate hendrerit ex, eget cursus purus. Pellentesque consequat erat leo, eleifend porttitor lacus porta at. Vivamus faucibus quam ipsum, id condimentum ligula malesuada ultrices. Nullam luctus leo elit, vitae rutrum nibh venenatis eget. Nam at sodales purus. Proin nulla tellus, lacinia eget pretium sed, vehicula aliquet neque. Morbi vel eros elementum, suscipit elit eu, consequat libero. Nulla nec aliquet neque. Nunc bibendum sapien lectus, sed elementum nisi rutrum non. Ut vulputate at lacus eget maximus.
Customizing your blog design
As a final detail only if you have time,
you can explore options for customizing the style of your blog. By
default, we are using the readthedown theme from the rmdformats
package (see Line 6 of this file if you want to switch out
themes).
Theme
You can use the rmdformats package to play around with some pre-built themes. There are, I’m sure, many many many more similar packages with built in themes, or you can look into how to include a CSS code chunk to customize aspects of a theme.
Using the rmdformats package, you can change the theme itself (Line 6):
rmdformats::readthedownrmdformats::downcute- For
downcuteonly, you can add a new indented line below Line 6 with the codedowncute_theme: "chaos"for thedowncute chaostheme
- For
rmdformats::robobookrmdformats::material
You can explore additional YAML options by looking at the rmdformats
package page or running, for example,
?rmdformats::readthedown() to see the help documentation
for a particular theme from the package.
Synax highlighting
You can also change the code chunk syntax highlighting option (Line
7, highlight):
"default""tango""pygments""kate""monochrome""espresso""zenburn""haddock""textmate"NULLfor no syntax highlighting (not recommended)
Font size, type, and other customization
Further customization requires adding a CSS style file or code chunk or incorporating other development options. Customization beyond the rmdformats package should be your lowest and final priority for the project. Ensure your content is fully prepared first.
References
Typically, references in R Markdown (and LaTeX) files are incorporated with a BibTeX database (a .bib file). You can try this approach or manually include either a numbered or alphabetized list.
You can list R package citations with the code
citation("packageName") in the console and then copy (and
reformat as needed) the relevant text, e.g.,
## To cite package 'DT' in publications use:
##
## Xie Y, Cheng J, Tan X (2023). _DT: A Wrapper of the JavaScript
## Library 'DataTables'_. R package version 0.29,
## <https://CRAN.R-project.org/package=DT>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {DT: A Wrapper of the JavaScript Library 'DataTables'},
## author = {Yihui Xie and Joe Cheng and Xianying Tan},
## year = {2023},
## note = {R package version 0.29},
## url = {https://CRAN.R-project.org/package=DT},
## }
The following citations are based on the American Statistical Association citation style (not all of these references are used in this document).:
Baumer, B. S., Kaplan, D. T., and Horton, N. J. (2021), Modern Data Science with R (2nd ed.), Boca Raton, FL: CRC Press.
Broman, K. W. and Woo, K. H. (2018), “Data Organization in Spreadsheets,” The American Statistician, 72:1, 2-10, doi: 10.1080/00031305.2017.1375989
Columbia University Libraries (n.d.), “Data Citation,” available at https://guides.library.columbia.edu/datacitation.
McNamara, A. and Horton N. J. (2018) “Wrangling Categorical Data in R,” The American Statistician, 72:1, 97-104, doi: 10.1080/00031305.2017.1356375.
Shah, Syed A. A. (October 2022), “Starbucks Drinks” (Version 1), Kaggle, available at https://www.kaggle.com/datasets/syedasimalishah/starbucks-drinks.
Xie Y, Cheng J, Tan X (2022). “DT: A Wrapper of the JavaScript Library ‘DataTables’,” R package version 0.24, available at https://CRAN.R-project.org/package=DT.
Article Sources:
Ma, Dorothy, and Alice Huang. “Evergrande under Pressure in Hong Kong Court to Repay Creditors.” Bloomberg.Com, Bloomberg, 28 Nov. 2023, www.bloomberg.com/news/features/2023-11-28/evergrande-under-pressure-in-hong-kong-court-to-repay-creditors.
Jeffrey Feltman, Sharan Grewal, et al. “The Israel and Gaza War: Economic Repercussions.” Brookings, 24 Oct. 2023, www.brookings.edu/articles/the-israel-and-gaza-war-economic-repercussions/.
Mena, Bryan. “Israel-Hamas War Risks Further Deglobalization and Inflation | CNN Business.” CNN, Cable News Network, 15 Oct. 2023, www.cnn.com/2023/10/15/economy/stocks-week-ahead-deglobalization/index.html.
“Defense Department Continues to Stress Law of War with Israel.” U.S. Department of Defense, www.defense.gov/News/News-Stories/Article/Article/3578196/defense-department-continues-to-stress-law-of-war-with-israel/. Accessed 5 Dec. 2023.
Smith, Elliot. “Goldman Sachs Says the Israel-Hamas War Could Have Major Implications for Europe’s Economy.” CNBC, CNBC, 7 Nov. 2023, www.cnbc.com/2023/11/03/goldman-says-israel-hamas-war-could-majorly-impact-europes-economy.html.
“CNBC Exclusive: CNBC TRANSCRIPT: JPMorgan Chase Chairman & CEO Jamie Dimon Speaks with CNBC’s Leslie Picker on ‘Power Lunch’ Today.” CNBC, CNBC, 2 Aug. 2023, www.cnbc.com/2023/08/02/cnbc-exclusive-cnbc-transcript-jpmorgan-chase-chairman-ceo-jamie-dimon-speaks-with-cnbcs-leslie-picker-on-power-lunch-today.html.
“2023 Economic Outlook: Insights & Trends [Midyear Update].” 2023 Economic Outlook: Insights & Trends [Midyear Update], J.P. Morgan Chase, 8 Dec. 2022, www.jpmorgan.com/insights/outlook/economic-outlook/economic-trends.
“Testimony by Chair Powell on the Semiannual Monetary Policy Report to the Congress.” Board of Governors of the Federal Reserve System, www.federalreserve.gov/newsevents/testimony/powell20230621a.htm. Accessed 5 Dec. 2023.
“Speech by Vice Chair for Supervision Barr on Financial Stability.” Board of Governors of the Federal Reserve System, www.federalreserve.gov/newsevents/speech/barr20231116a.htm. Accessed 5 Dec. 2023.
Rappeport, Alan, and Patricia Cohen. “Fragile Global Economy Faces New Crisis in Israel-Gaza War.” The New York Times, The New York Times, 10 Oct. 2023, www.nytimes.com/2023/10/10/business/economy/global-economy-israel-gaza-war.html.
Data Sources:
“CPI Home.” U.S. Bureau of Labor Statistics, U.S. Bureau of Labor Statistics, www.bls.gov/cpi/. Accessed 5 Dec. 2023.
“PETROLEUM & OTHER LIQUIDS.” Spot Prices for Crude Oil and Petroleum Products, www.eia.gov/dnav/pet/pet_pri_spt_s1_m.htm. Accessed 11 Dec. 2023.
Normal Sources:
https://www.energy.gov/articles/economic-impact-oil-and-gas#:~:text=Lower%20energy%20costs%2C%20driven%20by,energy%20in%20the%20United%20States.